<template>
  <div class="container-welcome">
    {{$store.state.globalMsg}}
    <button @click="fn">改vuex数据</button>
    <img src="../../assets/welcome.jpg" alt />
  </div>
</template>

<script>
export default {
  name: "page-welcome",
  methods: {
    fn() {
      // 修改vuex的数据
      this.$store.commit("updateGlobalMsg", "这里写修改了的数据");
    }
  }
};
</script>

<style scoped lang="less">
.container-welcome {
  img {
    display: block;
    margin: 10px auto 0;
  }
}
</style>